
	/* This is a simple polyhedra class that stores the data common
	   to all the other classes */

#include <windows.h>
#include <GL/gl.h>
#include <stdlib.h>

#include "point.h"
#include "normal.h"
#include "color.h"
#include "queue.h"

#ifndef _POLYHEDRA_H_
#define _POLYHEDRA_H_

class Polyhedra
{
protected:
	float size;				// the cube size it occupies
	GLuint ph;				// the compiled list
	int num_pts;			// number of points in the polyhedra

	int i;					// number of iterations
	float r;				// the ratio of self-similar triangles

	int colortheme, coloringmode;
	float red, green, blue;
	bool iterative;

	Point* p;

	virtual void _Draw (Point* pts);
		// Draw a tetrahedron

	void IterDraw ();
		// Draw the tetrahedron iteratively

	void RecurDraw(int i, Point* pts);
		// Draw the tetrahedron recursively

public:

	Polyhedra();

	Polyhedra(float _size);

	Polyhedra (float _size, int _i, float _r);

	virtual ~Polyhedra();

	virtual void Draw();
		// Draws a recursive polyhedra

	void Make();
		// Makes the polyhedra

	virtual void SetPoint (float _size);
		// Set the points of the polyhedra

	void DisplayPoint (Point& p);
		// Send a Point to openGl with the current coloring scheme

	void SetI(int _i) {i = _i;}
		// Sets the value of i

	int I() { return i;}
		// returns the value of i

	float R() { return r;}
		// returns the value of r

	void SetR (float _r) {r = _r;}
		// Sets the value of r

	void SetSize (float _size) { size = _size;}
		// Sets the value of the size

	float Size() { return size; }
		// returns the value of size

	void DrawFace (Point& pt, Point& p2, Point& p3);
		// Draw a face with three points

	void DrawFace (Point& p1, Point& p2, Point& p3,
		Point& p4);
		// Draw a face from four points that are on the same plane

	void DrawFace (Point& p1, Point& p2, Point& p3,
		Point& p4, Point& p5);
		// Draw a face from five points that are on the same plane

	void SetModes (int mode, int theme) { coloringmode = mode;
	colortheme = theme; }
		// Set the coloring mode and the coloring theme

	void SetColor (float r, float g, float b) {red=r;green=g;blue=b;}
		// Set the color for the one color mode

	void SetIterative (bool value) {iterative = value; }
};

#endif
